<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => 'Controle de Gerenciamento de Estágio Supervisionado',
    'preload' => array('log', 'booster'),
    'import' => array(
        'application.models.*',
        'application.components.*',
        'application.*',
    ),
    'defaultController' => 'main',
    'modules' => array(
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => '1',
        // 'ipFilters' => array('127.0.0.1', '::1'),
        ),
    ),
    'components' => array(
        'user' => array(
            'allowAutoLogin' => true,
            'class'          => 'application.components.EWebUser',
            'loginUrl'       => array('usuario/entrar')
        ),
        // http://www.yiiframework.com/doc/guide/1.1/en/topics.url
		
        'urlManager' => array(
            'urlFormat' =>
            'path',
            'showScriptName' => false,
            'rules' => array(
                '' => 'main/index',
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ),
        ),
        'cache' => array(
            'class' => 'system.caching.CFileCache'
        ),
        'db' => array(
            'connectionString' => 'mysql:host=127.0.0.1;dbname=deps',
            'schemaCachingDuration' => 3660,
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ),
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'main/error',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning',
                ),
                // uncomment the following to show log messages on web pages
//                array(
//                    'class' => 'CWebLogRoute',
//                ),
            ),
        ),
    ),
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => array(
        'adminEmail' => 'webmaster@example.com',
    ),
);
